<template>
  <div class="header">
    <div>
      <MenuIcon
      class="lin_heaer_menuicon"
      @click="OpenMenuDialog"
      />
      <div class="menu_list">
        <ul>
          <li>
            <NuxtLink to="/"><a>Home</a></NuxtLink>
          </li>
          <li>
            <NuxtLink to="/about"><a>About</a></NuxtLink>
          </li>
          <li>
            <NuxtLink to="/services"><a>Services</a></NuxtLink>
          </li>
          <li>
            <NuxtLink to="/works"><a>Works</a></NuxtLink>
          </li>
          <li>
            <NuxtLink to="/login"><a>Blog</a></NuxtLink>
          </li>
          <li>
            <NuxtLink to="/contact"><a>Contact</a></NuxtLink>
          </li>
        </ul>
      </div>
    </div>
    <div>
      <div class="header-icons">
        <GitIconList/>
      </div>
      <div style="margin-bottom: 10px">
        <p>Lin.</p>
        <p>SpectraWeb</p>
      </div>
      <div class="lin_copyright">
        <span>CopyRight @2024 Xie Lin Cai.</span><br>
        <span>All right reserved</span>
      </div>
    </div>
  </div>


</template>


<script lang="ts">
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import { defineComponent, ref, onMounted, reactive, toRefs } from "vue";
// import { onBeforeRouteUpdate } from "vue-router";

gsap.registerPlugin(ScrollTrigger);

export const useModelWrapper = (props: any, emit: any, name = 'modelValue') => {
  return computed({
    get: () => props[name],
    set: (value) => emit(`update:${name}`, value),
  })
}

export default defineComponent({
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    editData: {
      type: Object,
    }
  },
   async setup(props: any, { emit }: any){
    const header_menu = useModelWrapper(props, emit, 'visible')
    const router = useRouter()
    const OpenMenuDialog = async() => {
      emit('open-menu-dialog', 'none')
    }
 

    onMounted(() => {
    })



    return{
      OpenMenuDialog
    }
  }
})
</script>



<style scoped>

*{
  color: white;
}

.header {
  position: fixed;
  height: 100%;
  width: 140px;
  display: grid;
  place-items: center;
  align-items: center;
  text-align: center;
  background-color: black;
  font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  font-size: 20px;
}

.menu_list {
  color: white;
  line-height: 50px;
  margin-left: 10px;
}

.menu_list li{
  cursor: pointer;
  text-align: start;
}

.menu_list li a {
  position: relative;
}


.menu_list li a::after,
.menu_list li a::before {
  content: '';
  width: 0%;
  height: 2px;
  position: absolute;
  bottom: 8px;
  width: 0%;
  height: 3px;
  background: #ff009d;
  display: block;
  transition: 0.5s;
}

.menu_list li a:hover::after {
  width: 100%;
}

.menu_list li:active{
  transform: translateY(1px);
}


.header div {
  align-items: center;
  text-align: center;
}

.header p {
  color: white;
}

.header-icons {
  position: absolute;
  bottom: 30%;
  left: 20%;
}

.lin_copyright {
  color: white;
  font-size: 8px
}


.lin_heaer_menuicon {
  display: block;
}


</style>